
#ifndef _MEMBER_BBUTTON_H_
#define _MEMBER_BBUTTON_H_

#include <BColor>
#include <BIcon>
#include <BImage>
#include <BMenu>
#include <BButton>
#include "IAlignment.h"

#define button_member(button)		((member_BButton*)((BButton*)button)->_ptr)

namespace BWE
{
	class member_BButton : public BObject
	{
		friend class BButton;
	public:
		member_BButton(BButton* button);
		~member_BButton();

		BIcon* realIcon();
		bool imageShown();
		void freshRects();

		void slotActionAbleChanged(BObject* object, const BValue& value);
		void slotActionIconChanged(BObject* object, const BValue& value);
		void slotActionTextChanged(BObject* object, const BValue& value);
		void slotActionChecked(BObject* object, const BValue& value);

		void slotMenuHide(BObject* object, const BValue& value);
		void slotMenuAbleChanged(BObject* object, const BValue& value);
		void slotMenuTitleChanged(BObject* object, const BValue& value);
		void slotMenuStyleChanged(BObject* object, const BValue& value);

		BButton*		boss;
		BColor			color;
		Graph			graph;
		BString			text;
		BString			checkedText;
		BString			uncheckText;
		BImageHolder	image;
		BIconHolder		icon;
		BSize			iconSize;
		BActionHolder	action;
		BMenuHolder		menu;
		bool			checkable;
		bool			checked;

		bool			dirty;
		IAlignment		alignment;
		BString			t_text;
		BString			t_text_checked;
		BString			t_text_uncheck;
		State			state;
	};
}

#endif